package 对象的使用;

public class test {
    public static void main(String[]args){
        Human p1=new Human();
        p1.setName("小汪");
        p1.setAge(18);
        p1.setSalary(1000000);
        Food fish=p1.cooking("水煮鱼");//调用cooking方法创建一个Food对象fish
        Human p2=new Human();
        p2.setName("小何");
        p2.setAge(20);
        p2.setSalary(1000);
       String s=p2.eat(fish);
       System.out.println(s);
       System.out.println(fish.toString());
    }
}
